
import request from "./request"

// 添加角色
export const AddRoleApi = (label:string,value:number,color:string)=>{
    return request.post<any,axiosType<roleTypes>>("/pro/role/add",{
        label,
        value,
        color
    })
}

// 获取列表
export const getRoleApi = (label?:string)=>{
    return request.post<any,axiosType<roleTypes[]>>("/pro/role/list",{
        label
    })
}

// 修改角色
export const uplodRoleApi = (color:string,label:string,_id:string)=>{
    return request.post<any,axiosType<uploadRoleTypes>>('/pro/role/update',{
        label,
        color,
        _id
    })
}

export const deleRole = ( _id:string)=>{
    return request.post<any,axiosType<{acknowledged:boolean,deletedCount:number}>>("/pro/role/delete",{
        _id
    })
}